import send from '../config/mailConfig';

class LoginController {
  constructor() {}

  async forget(ctx) {
    const { body } = ctx.request;
    console.log('body: ', body);
    try {
      const result = await send({
        expire: new Date(),
        user: 'duoduo',
        ...body,
      });
      ctx.body = {
        code: 200,
        data: result,
        msg: '邮件发送成功'
      };
    } catch (e) {}
  }
}

export default new LoginController()